<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <style>
/*        采用 Flex 布局的元素，称为 Flex 容器（flex container），
简称"容器"。它的所有子元素自动成为容器成员，
称为 Flex 项目（flex item），简称"项目"。*/
/*容器拥有六个属性
flex-direction
flex-wrap
flex-flow
justify-content
align-items
align-content*/

/*flex-direction 有4个值
row（默认值）：主轴为水平方向，起点在左端。
row-reverse：主轴为水平方向，起点在右端。
column：主轴为垂直方向，起点在上沿。
column-reverse：主轴为垂直方向，起点在下沿。*/
        .box{
            display: flex;
            flex-direction:row;
        }
        .box-child{
            width:100px;
            height:100px;
            margin-left:10px;
            margin-top:10px;
            background:yellow;
        }
        .box-rs{
            display:flex;
            flex-direction:row-reverse;
        }
        .box-column{
            display:flex;
            flex-direction:column;
        }
        .box-column-reverse{
            display:flex;
            flex-direction:column-reverse;
            background:green;
        }
    </style>
</head>
<body>
<div class="box">
    <div class="box-child">1</div>
    <div class="box-child">2</div>
    <div class="box-child">3</div>
    <div class="box-child">4</div>
    <div class="box-child">5</div>
</div>
<div class="box-rs">
    <div class="box-child">1</div>
    <div class="box-child">2</div>
    <div class="box-child">3</div>
    <div class="box-child">4</div>
    <div class="box-child">5</div>
</div>
<div class="box-column">
    <div class="box-child">1</div>
    <div class="box-child">2</div>
    <div class="box-child">3</div>
    <div class="box-child">4</div>
    <div class="box-child">5</div>
</div>
<div class="box-column-reverse">
    <div class="box-child">1</div>
    <div class="box-child">2</div>
    <div class="box-child">3</div>
    <div class="box-child">4</div>
    <div class="box-child">5</div>
</div>
</body>
</html>